import { http } from "@/utils/http";
import { downloadFile } from "../../file"
import { exportFile } from "../../export";

export const getAllList = params => {
  return http.request("get", "/business/average-user-merchants-deal", params);
};

export function getPageList(params) {
  return http.request("get", "/business/average-user-merchants-deal/paged-list", { params });
}

export function getNotSignList(params) {
  return http.request("get", "/business/average-user-merchants-deal/not-sign-paged-list", { params });
}

export const submitData = (params: any) => {
  return http.request(params.id ? "put" : "post", `/business/average-user-merchants-deal/${params.id ?? ""}`, {
    data: params
  });
};

export const getSingle = (id: number) => {
  return http.request("get", `/business/average-user-merchants-deal/${id}`);
};

export const deleteData = (id: number) => {
  return http.request("delete", `/business/average-user-merchants-deal/${id}`);
};

export const download = (id) => {
  downloadFile(`/business/average-user-merchants-deal/${id}/download`);
}

export function exportData(id) {
  exportFile(`/business/average-user-merchants-deal/${id}/export`);
}